Skip to content

Fix game imports from Stem Script based projects#20

Merged
papiguy merged 10 commits into
mainfrom
fix/oss-model-import-zip
Jun 1, 2026
Merged

Fix game imports from Stem Script based projects#20
papiguy merged 10 commits into
mainfrom
fix/oss-model-import-zip

Conversation

@papiguy
Copy link
Copy Markdown
Contributor

@papiguy papiguy commented May 31, 2026

No description provided.

anchukhanna and others added 10 commits May 29, 2026 09:02
…ayground smokes

- scene/v2.ts: derive showHud from persisted userData.game (default false)
  instead of hardcoding true, so the HUD is opt-in and no longer appears on
  every reload/replay.
- CLAUDE.md: document that editor lifecycle hooks run without init(), the
  erth-undefined crash class, and that gameObject has no .game.
- EngineRuntime.ts: clarify HUD teardown is owned by game.reset()->hud.clear().
- Add Playwright smokes: solar-system playground, HUD replay-leak, and a
  generic all-games playground harness.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sync game settings booleans to scene data
Brings in PR #19 (Pirate game import fixes) plus README/team updates.

Conflict in script-tool/ImportBatchDialog.ts (autoResolveImports):
both sides reworked the per-import extension matching. Kept HEAD's
shared `extOf` predicate, which the rest of the function depends on
(filepath match at folderFiles.filter(extOf) and the claimed-filtered
fuzzy fallback that redeclares its own local `extMatches`). origin's
two intents are already covered on this branch: reusing a claimed model
file across multiple imports is handled by resolving filepath against
the full unfiltered list, and the no-extension-match case is skipped
naturally downstream. Added a comment recording why.
The script-tool model import hardcoded "application/zip" as the source
container for every model, forcing all files through JSZip's expandZip.
That only works for models bundled as real ZIP archives (e.g. pirate-ship
.glb files are PK\x03\x04 zips of model + textures). Raw .glb/.gltf/.fbx/
.obj files (100-cars, 3d-chess) failed with "Can't find end of central
directory" and returned {success:false} per model WITHOUT throwing, so the
script kept running, behaviors still imported, and exec reported "done".
Across a mixed library this looked like "about half the models and
behaviors silently don't import" — behaviors that reference the missing
models then appear broken downstream.

Fix: sniff the first 4 bytes and pass "application/zip" only for true
PK\x03\x04 archives, "" otherwise — so zip-wrapped models keep their exact
path and raw model files load directly with their companion files. This
matches every other loadModelFromFile caller, which lets the function
auto-detect the container.

Verified via persisted-scene introspection:
- 3d-chess: 0 -> 6/6 models + 6 model assets
- 100-cars: 0 -> 11/11 models + 11 model assets
- pirate-ship: zip path unchanged (logs confirm expandZip + texture
  overrides + convertToGlb running normally)

Also includes related in-progress OSS import work (behavior dedup,
asset-revision stability, image-derivative fallback) and the
repro-import-inspect.mjs harness used to diagnose this.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Quick start listed the Bun/Go/Node prerequisites but never said how to
install them per platform. Add a "Setting up your dev environment" section
with install steps for macOS (Homebrew), Linux (bun script + nvm + Go
tarball), and Windows (WSL2 recommended, since the npm scripts use inline
BUILD_MODE=oss env prefixes and .sh deploy scripts that don't run under
native cmd/PowerShell), plus a verify step. Cross-link with Quick start.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reuse duplicate model assets during batch imports and report unresolved or stalled imports instead of silently skipping them.

Surface corrupt or missing persisted assets as save/load failures, stop mirroring large scene drafts into localStorage, and keep focused tests/playwright diagnostics with the change.
@papiguy papiguy merged commit a4f85f4 into main Jun 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants